#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int Count = 0;
void BFS(int step,int arr[],int n,int s,int next[])
{
	if (step==n)
	{
		int sum = 0;
		for (int i = 0; i < n; i++)sum += arr[i];
		if (sum == s)
		{
			Count++;
			//for (int i = 0; i < n; i++)cout << arr[i] << ' ';
			//cout << endl;
		}
		Count %= 100000007;
		return;
	}
	else
	{
		for (int i = 0; i < 2;i++)
		{
			arr[step] = arr[step - 1] + next[i];
			BFS(step + 1, arr, n, s, next);
		}
	}
}
int main()
{
	int n, s, a, b;
	while (cin>>n>>s>>a>>b)
	{
		int next[2] = { a, -b };
		int t = b*n;
		int t1 = -n*a;
		int arr[1010]{0};
		while (t>=t1)
		{
			arr[0] = t;
			BFS(1, arr, n, s, next);
			t--;
		}
		cout << Count << endl;
	}
	return 0;
}